projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
49a6e0c
)
switch: allow the user to toggle the switch by clicking on the handle
author
Thomas Wood
<thos@gnome.org>
Tue, 11 Jan 2011 11:34:23 +0000
(11:34 +0000)
committer
Matthias Clasen
<mclasen@redhat.com>
Wed, 12 Jan 2011 23:50:45 +0000
(18:50 -0500)
gtk/gtkswitch.c
patch
|
blob
|
history
diff --git
a/gtk/gtkswitch.c
b/gtk/gtkswitch.c
index 28a5d8d46862ff8fd1feaa4d43b76b1119f1cfcc..6b9866e1676d1adc920d776e3615802068a92470 100644
(file)
--- a/
gtk/gtkswitch.c
+++ b/
gtk/gtkswitch.c
@@
-202,6
+202,15
@@
gtk_switch_button_release (GtkWidget *widget,
return TRUE;
}
+ /* toggle the switch if the handle was clicked but a drag had not been
+ * initiated */
+ if (!priv->is_dragging && !priv->in_press)
+ {
+ gtk_switch_set_active (GTK_SWITCH (widget), !priv->is_active);
+
+ return TRUE;
+ }
+
/* dragged toggle */
if (priv->is_dragging)
{